package org.smarthings.test;

public class RemoteTest2 extends AbstractClient {
	public static void main(String[] args) {
		URI = "services/things/registrations";
		post(coap, "{\"name\":\"termometer\",\"properties\":[\"temperature\"]}");
		post(coap, "{\"name\":\"switch\",\"actions\": [\"toggle\"],\"properties\":[\"onoff\"]}");

		URI = "services/rules";
		String rule = "{\"trigger\":{\"expression\":\"every ThingPropertyChanged(thing.UUID='" + 1
				+ "',property.name='temperature')\"},\"action\":{\"script\":\"things.getThing('" + 2
				+ "').getActions().getActionByUUID('" + 1
				+ "').execute(null)\",\"language\":\"js\"},\"condition\":{\"script\":\"true\",\"language\":\"js\"}}";
		post(http, rule);

		URI = "services/things/" + 2 + "/actions/executions/" + 1 + "/arguments";
		thread(coap);
		sleep(1000);

		URI = "services/things/" + 1 + "/properties/" + 1 + "/value";
		post(coap, "37");
	}
}